package com.distributor.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 返回参数封装
 *
 * @author zhanghaogao
 * @create 2017-11-15 下午2:21
 **/

@Data
@AllArgsConstructor
@NoArgsConstructor
@SuppressWarnings("serial")
public class ReturnObject<T> implements Serializable {
    /**
     * 返回code
     */
    Integer code;

    /**
     * 返回内容
     */
    String msg;


    /**
     * 数据条数
     */
    Integer count;

    /**
     * 数据页数
     */
    Integer pages;

    /**
     * 返回参数
     */
    T data;

    public ReturnObject(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public ReturnObject(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


}
